package com.jinbo.footmessageworker.httpretrofit;

import com.jinbo.footmessageworker.httpbean.BaseBean;
import com.jinbo.footmessageworker.httpbean.LookSignBean;
import com.jinbo.footmessageworker.httpbean.OrderBean;
import com.jinbo.footmessageworker.httpbean.OrdersBean;
import com.jinbo.footmessageworker.httpbean.SignBean;
import com.jinbo.footmessageworker.httpbean.TurnsBean;
import com.jinbo.footmessageworker.httpbean.WorkerInformationBean;

import retrofit.Callback;
import retrofit.http.Field;
import retrofit.http.FormUrlEncoded;
import retrofit.http.GET;
import retrofit.http.Multipart;
import retrofit.http.POST;
import retrofit.http.Part;
import retrofit.http.Query;
import retrofit.mime.TypedFile;


public interface HttpProtocol {
    /**
     * 登录
     *
     * @param name
     * @param passWord
     * @param callback
     */
    @FormUrlEncoded
    @POST("/Worker/Login")
    public void login(@Field("name") String name,
                      @Field("password") String passWord,
                      Callback<BaseBean<WorkerInformationBean>> callback);

    /**
     * 修改密码
     *
     * @param user_id
     * @param old_password
     * @param new_password
     * @param callback
     */
    @FormUrlEncoded
    @POST("/Worker/UpdatePassword")
    public void modifyUserPassword(
            @Field("user_id") String user_id,
            @Field("old_password") String old_password,
            @Field("new_password") String new_password,
            Callback<BaseBean<WorkerInformationBean>> callback);

    /**
     * 修改头像
     *
     * @param user_id
     * @param file
     * @param kind
     */
    @Multipart
    @POST("/Worker/Head")
    public void modifyFace(
            @Part("user_id") String user_id,
            @Part("file") TypedFile file,
            @Part("kind") int kind,
            Callback<BaseBean<WorkerInformationBean>> callback);

    /**
     * 修改用户信息
     *
     * @param user_id
     * @param user_information
     * @param user_kind
     * @param callback
     */
    @FormUrlEncoded
    @POST("/Worker/Information")
    public void modifyUserInformation(
            @Field("user_id") String user_id,
            @Field("user_information") String user_information,
            @Field("user_kind") int user_kind,
            Callback<BaseBean<WorkerInformationBean>> callback);

    /**
     * 修改项目
     *
     * @param user_id
     * @param project_ids
     * @param callback
     */
    @FormUrlEncoded
    @POST("/Worker/Projects")
    public void modifyProjects(
            @Field("user_id") String user_id,
            @Field("project_ids") String project_ids,
            Callback<BaseBean<WorkerInformationBean>> callback);

    /**
     * 获取项目表
     */
    @GET("/Worker/GetProjects")
    public void getProjects(Callback<BaseBean<WorkerInformationBean>> callback);

    /**
     * 获取我的项目
     *
     * @param user_id
     */
    @GET("/Worker/GetMyProjects")
    public void getMyProjects(@Query("user_id") String user_id,
                              Callback<BaseBean<WorkerInformationBean>> callback);

    /**
     * 技师查询待确认订单
     *
     * @param worker_id
     */
    @GET("/Worker/NotComfirmOrder")
    public void notConfirmOrder(@Query("worker_id") String worker_id,
                                Callback<BaseBean<OrdersBean>> callback);


    /**
     * 技师接收待确认的单
     *
     * @param id
     */
    @GET("/Worker/SureNotComfirmOrder")
    public void sureOrder(@Query("id") int id,
                          @Query("do_time") String do_time,
                          Callback<BaseBean<OrdersBean>> callback);

    /**
     * 技师拒绝待确认的单
     *
     * @param id
     */
    @GET("/Worker/RejectNotComfirmOrder")
    public void rejectOrder(@Query("id") int id,
                            @Query("do_time") String do_time,
                            @Query("reason") String reason,
                            Callback<BaseBean<OrdersBean>> callback);

    /**
     * 技师查询已接订单
     *
     * @param worker_id
     */
    @GET("/Worker/DealtOrder")
    public void dealtOrder(@Query("worker_id") String worker_id,
                           Callback<BaseBean<OrdersBean>> callback);

    /**
     * 技师完成接收的单
     *
     * @param id
     */
    @GET("/Worker/CompleteOrder")
    public void completeOrder(@Query("id") int id,
                              @Query("do_time") String do_time,
                              Callback<BaseBean<OrdersBean>> callback);

    /**
     * 技师撤销已接的单
     *
     * @param id
     */
    @GET("/Worker/CancelOrder")
    public void cancelOrder(@Query("id") int id,
                            @Query("do_time") String do_time,
                            @Query("reason") String reason,
                            Callback<BaseBean<OrdersBean>> callback);


    /**
     * 查询历史订单
     *
     * @param worker_id
     */
    @GET("/Worker/HistoryOrder")
    public void historyOrder(@Query("worker_id") String worker_id,
                             @Query("start") int start,
                             @Query("limit") int limit,
                             Callback<BaseBean<OrdersBean>> callback);


    /**
     * 查询班次
     *
     * @param worker_id
     */
    @GET("/Worker/Turn")
    public void turn(@Query("worker_id") String worker_id,
                     @Query("start_date") int start,
                     @Query("limit") int limit,
                     Callback<BaseBean<TurnsBean>> callback);

    /**
     * 技师上下班签到
     * <p/>
     * <p/>
     * worker_id:string 技师ID
     * longitude:number 经度
     * latitude:number 纬度
     * time:string 签到时间（格式：格式2016-03-07 16:22:00）
     * date:string 今天日期（格式：格式2016-03-07 ）
     * kind:int
     */
    @FormUrlEncoded
    @POST("/Worker/Sign")
    public void sign(
            @Field("worker_id") String worker_id,
            @Field("longitude") double longitude,
            @Field("latitude") double latitude,
            @Field("time") String time,
            @Field("date") String date,
            @Field("kind") int kind,
            Callback<BaseBean<SignBean>> callback);

    /**
     * 查询上下班签到
     *
     * @param worker_id
     */
    @GET("/Worker/LookSign")
    public void lookSign(@Query("worker_id") String worker_id,
                         @Query("date") String date,
                         Callback<BaseBean<LookSignBean>> callback);
}
